#ifndef _VOXEL_H_
#define _VOXEL_H_

#include "constant.h"
#include "model.h"
#include <GL/glut.h>

void drawTriangleFan(float x, float y, float z_top, float z_bottom,
                     float radius, int num);

void drawQuadFan(float x, float y, float z_top, float z_bottom, float radius,
                 int num);

// Suppose the circle is on the xy plane
void drawCircle(float x, float y, float radius);

/*
void drawCircle(float x, float y, float radius, int num) {

    float circle_x, circle_y;
    glBegin(GL_TRIANGLE_FAN);
    glTexCoord2f(0.5, 0.5);
    glVertex3f(x, y, 0);
    for (int i = 0; i < num; i++) {
        circle_x = x + radius * cos(2.0 * PI * (float(i) / num));
        circle_y = y + radius * sin(2.0 * PI * (float(i) / num));

        glTexCoord2f(0.5 + 0.5*cos(2.0 * PI * (float(i) / num)), 0.5 +
0.5*sin(2.0 * PI * (float(i) / num))); glVertex3f(circle_x, circle_y, 0);
    }
    glEnd();
}
*/
class Cube : public Model {
private:
    virtual void drawCoordinates();
};

class Sphere : public Model {
private:
    virtual void drawCoordinates();
};

class Cylinder : public Model {
private:
    float radius, height;
    GLUquadricObj *cylinder;
    virtual void drawCoordinates();
public:
    Cylinder(float radius_, float height_);
    Cylinder();
};

class Cone : public Model {
private:
    float radius, height;
    GLUquadricObj *cylinder;
    virtual void drawCoordinates();
public:
    Cone(float radius_, float height_);
    Cone();
};

class Pyramid : public Model {
private:
    float radius, height;
    int num; //侧面面数
    virtual void drawCoordinates();
public:
    Pyramid(float radius_, float height_, int num_);
    Pyramid(int num_);
};

class Prism : public Model {
private:
    float radius, height;
    int num; //侧面面数
    virtual void drawCoordinates();
public:
    Prism(float radius_, float height_, int num_);
    Prism(int num_);
};

#endif